The reflection mechanism of go is to be carried out through the interface, and the null interface of object like Java can interact with any type, so reflection on the basic data type is also directly used in this feature.Package Mainimport ("FMT"
https://golang.org/pkg/reflect/The most important official documents, it is recommended to rough time to see this article first.
Go's reflect is still relatively simple, can quickly get started.
Database OperationsView all Databases
hive> show databases;
working with default databases
hive> Use default;
View database Information
Hive > describe database default;OkDb_name Comment location owner_name owner_
This is a creation in
Article, where the information may have evolved or changed.
Determine the type of reflectvalue and extract the data
Addressable
Gets the name of the struct method
Judge reflect. Value type
This is a creation in
Article, where the information may have evolved or changed.
Functions in the Value.go
Func Append (S Value, x ... Value) value
Func Appendslice (S, t value) value
Func Indirect (v value)
(gdb) Mapkeys c-b: Break "${fname}": ${lnum} # Set breakpoint @ Current line c-d: Down c-e: Clear "${fname} ": ${lnum} # Clear breakpoint at current line c-n: Next c-p: Print ${text} # Print value of selection at MOUs E position c-u:
STL containers can be grouped into the following broad categories:One: Sequence container, vector, list, deque, String.
II: Associated containers, with set, Multiset, map, Mulmap
Hash_set,hash_map, Hash_multiset, Hash_multimap
Third: Other
STL the container can be divided into the following major categories :One: Sequence container, with vector, list, deque, string.
two : Associative Container , There are set, Multiset, map, Mulmap, hash_set, Hash_map, Hash_multiset,
hive Array, map, struct use
Hive provides a composite data type:Structs:structs internal data can be accessed via dot (.), for example, a column C in a table is of type struct{a int; b int}, we can access domain A by C.AMaps (k-v pair): Access to
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.